const { exec } = require('child_process');
const path = require('path');
const fs = require('fs');

// Run the TypeScript compiler with special options
const compileCommand = 'npx tsc --skipLibCheck true';

console.log(`Running compiler: ${compileCommand}`);
const child = exec(compileCommand, { cwd: __dirname });

child.stdout.on('data', (data) => {
  console.log(data);
});

child.stderr.on('data', (data) => {
  console.error(data);
});

child.on('close', (code) => {
  console.log(`Compilation process exited with code ${code}`);
  if (code === 0) {
    console.log('Compilation successful!');
  } else {
    console.log('Compilation failed. Check errors above.');
  }
});
